package test1;

/**
 * @author jj
 * @date 2019/11/8 15:53
 */
public class MyThread extends Thread{
    public void run(){
        for(int i = 0;i<100;i++){
            System.out.println("1111");
        }
        MyThread2 mt2 = new MyThread2();
        mt2.setName("线程2");
        mt2.start();

        System.out.println("@@@@@@@@@@@@@@@@");
    }
}

class MyThread2 extends Thread{
    public void run(){
        for(int i = 0;i<100;i++){
            System.out.println("1113444");
        }
        try {
            Thread.sleep(5000);
        }catch (Exception e){

        }
    }
}
class ThreadDemo{
public static void main(String[] args){
        MyThread mt1 = new MyThread();
        mt1.setName("线程1");
        mt1.start();
        }

        }